{% extends "mall_base.html" %}
{% block title %}

<title>添加商品</title>

{% endblock %}

{% block content %}
{#    添加商品种类#}
    <h1>商品种类添加</h1>
            <hr>
    <div class="container">
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            <form action="/malladmin/" method="post" class="form-signin">
                {% csrf_token %}

                <label for="inputEmail" class="sr-only">商品种类</label>
                <input type="text" name="category_name" id="inputEmail" class="form-control" placeholder="种类名" required autofocus><br>
                <button class="btn btn-lg btn-primary btn-block" type="submit">添加商品种类</button><span>{{ msg }}</span>
            </form>
        </div>
    </div>
</div>
{#    添加商品#}
    <h1>商品添加</h1>
            <hr>
    <div class="container">
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            <form action="/malladmin/" method="post" class="form-signin">
                {% csrf_token %}

                <label for="inputEmail" class="sr-only">商品</label>
                <input type="text" name="goods_name" id="inputEmail" class="form-control" placeholder="商品名" required autofocus><br>

                <label for="inputEmail" class="sr-only">商品种类</label>
                <input type="text" name="category_id" id="inputEmail" class="form-control" placeholder="商品种类" required autofocus><br>

                <label for="inputEmail" class="sr-only">商品价格</label>
                <input type="text" name="goods_price" id="inputEmail" class="form-control" placeholder="商品价格" required autofocus><br>

                <label for="inputEmail" class="sr-only">商品描述</label>
                <input type="text" name="goods_description" id="inputEmail" class="form-control" placeholder="商品描述" required autofocus><br>

                <label for="inputEmail" class="sr-only">商品库存</label>
                <input type="text" name="goods_stock" id="inputEmail" class="form-control" placeholder="商品库存" required autofocus><br>
                <button class="btn btn-lg btn-primary btn-block" type="submit">添加商品</button><span>{{ msg }}</span>
            </form>
        </div>
    </div>
</div>
{#    添加商品推荐#}
    <h1>商品推荐添加</h1>
            <hr>
    <div class="container">
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            <form action="/malladmin/" method="post" class="form-signin">
                {% csrf_token %}

                <label for="inputEmail" class="sr-only">商品推荐</label>
                <input type="text" name="recommend_name" id="inputEmail" class="form-control" placeholder="商品名" required autofocus><br>
                <button class="btn btn-lg btn-primary btn-block" type="submit">添加推荐商品</button><span>{{ msg }}</span>
            </form>
        </div>
    </div>
</div>

    <script>
        var msg = "{{ msg }}";
            if (msg) {
                alert(msg);
            }
    </script>
{% endblock %}